home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / misc / popen.h < prev    next >
C/C++ Source or Header  |  1996-08-03  |  575b  |  36 lines

  1. #pragma interface
  2. #ifndef POPEN_H
  3. #define POPEN_H
  4.  
  5. class POPEN{
  6.     int pid;
  7.     int status;
  8.     struct {
  9.         int out;
  10.         int err;
  11.     }fds;
  12.     SSTRING outbuf;
  13.     SSTRING errbuf;
  14.     /*~PROTOBEG~ POPEN */
  15. public:
  16.     POPEN (const char *command);
  17.     int getstatus (void);
  18.     int isok (void);
  19.     int readerr (char *line, int size);
  20. private:
  21.     void readif (struct fd_set *in, int fd, SSTRING&buf);
  22.     int readline (char *line, int size, SSTRING&buf);
  23. public:
  24.     int readout (char *line, int size);
  25.     int wait (int timeout);
  26. private:
  27.     void waitend (void);
  28. public:
  29.     ~POPEN (void);
  30.     /*~PROTOEND~ POPEN */
  31. };
  32.  
  33.  
  34. #endif
  35.  
  36.